package com.shuda.business.data.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 脚本配置实体类
 */
@Data
@TableName("t_script_config")
@Schema(name = "ScriptConfigEntity", description = "脚本配置实体")
public class ScriptConfigEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    @Schema(description = "引擎ID")
    private Long engineId;

    @Schema(description = "脚本名称")
    private String scriptName;

    @Schema(description = "脚本类型(groovy-Groovy脚本,javascript-JavaScript脚本,python-Python脚本)")
    private String scriptType;

    @Schema(description = "脚本内容")
    private String scriptContent;

    @Schema(description = "脚本参数(JSON)")
    private String scriptParams;

    @Schema(description = "执行顺序")
    private Integer executionOrder;

    @Schema(description = "状态(enabled-启用,disabled-禁用)")
    private String status;

    @Schema(description = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新人")
    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "删除标记(0-正常,1-删除)")
    @TableLogic
    private Integer deleted;
}